package com.basics.framework.manager;

import java.util.TimerTask;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class AsyncManager {
    private final int OPERATE_DELAY_TIME = 10;
    private ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(5);
    private static AsyncManager me = new AsyncManager();

    public AsyncManager() {
    }

    public static AsyncManager me() {
        return me;
    }

    public void execute(TimerTask task) {
        this.executor.schedule(task, 10L, TimeUnit.MILLISECONDS);
    }
}
